# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=libretro-bsnes2014
pkgver=577
pkgrel=2
epoch=1
pkgdesc='Super Nintendo Entertainment System cores'
arch=(loong64 x86_64)
url=https://github.com/libretro/bsnes2014.git
license=(GPL3)
groups=(libretro)
depends=(libretro-core-info)
makedepends=(git)
_commit=cffc626a7814050320cee9e59ad43fe10bbcb6ab
source=(libretro-bsnes2014::git+https://github.com/libretro/bsnes2014.git#commit=${_commit})
b2sums=(SKIP)

prepare() {
  for p in accuracy balanced performance; do
    cp -r libretro-bsnes2014 libretro-bsnes2014-${p}
  done
}

pkgver() {
  cd libretro-bsnes2014
  git rev-list --count HEAD
}

build() {
  for p in accuracy balanced performance; do
    make PROFILE=${p} -C libretro-bsnes2014-${p}
  done
}

package() {
  for p in accuracy balanced performance; do
    install -Dm 644 libretro-bsnes2014-${p}/bsnes2014_${p}_libretro.so -t "${pkgdir}"/usr/lib/libretro/
  done
}

# vim: ts=2 sw=2 et:
